home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Devices and Hardware / Display Manager / Play Video Sample / RequestVideo.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  3.3 KB  |  74 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        RequestVideo.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by: Eric Anderson    
  7.  
  8.     Copyright:    Copyright © 1995-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/15/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 5/31/95        ewa                Added RVGetCurrentVideoSetting and RVConfirmVideoRequest routines
  21.                                             to make it easy to revert back to where you came from and to give
  22.                                             the user a chance to confirm the new setting if the new mode was
  23.                                             valid (ie: the card supports it) but not safe (the monitor may not).
  24.                 5/24/95        ewa                Give the kAllValidModesBit requestFlags option for safe only or all
  25.                                             valid resolution timings.
  26.     
  27.                 
  28.  
  29. */
  30.  
  31. #include <QuickDraw.h>
  32. #include <Video.h>
  33.  
  34. // requestFlags bit values in VideoRequestRec (example use: 1<<kAbsoluteRequestBit)
  35. enum {
  36.     kBitDepthPriorityBit        = 0,    // Bit depth setting has priority over resolution
  37.     kAbsoluteRequestBit            = 1,    // Available setting must match request
  38.     kShallowDepthBit            = 2,    // Match bit depth less than or equal to request
  39.     kMaximizeResBit                = 3,    // Match screen resolution greater than or equal to request
  40.     kAllValidModesBit            = 4        // Match display with valid timing modes (may include modes which are not marked as safe)
  41. };
  42.  
  43. // availFlags bit values in VideoRequestRec (example use: 1<<kModeValidNotSafeBit)
  44. enum {
  45.     kModeValidNotSafeBit        = 0        //  Available timing mode is valid but not safe (requires user confirmation of switch)
  46. };
  47.  
  48. // video request structure
  49. struct VideoRequestRec    {
  50.     GDHandle        screenDevice;        // <in/out>    nil will force search of best device, otherwise search this device only
  51.     short            reqBitDepth;        // <in>        requested bit depth
  52.     short            availBitDepth;        // <out>    available bit depth
  53.     unsigned long    reqHorizontal;        // <in>        requested horizontal resolution
  54.     unsigned long    reqVertical;        // <in>        requested vertical resolution
  55.     unsigned long    availHorizontal;    // <out>    available horizontal resolution
  56.     unsigned long    availVertical;        // <out>    available vertical resolution
  57.     unsigned long    requestFlags;        // <in>        request flags
  58.     unsigned long    availFlags;            // <out>    available mode flags
  59.     unsigned long    displayMode;        // <out>    mode used to set the screen resolution
  60.     unsigned long    depthMode;            // <out>    mode used to set the depth
  61.     Fixed             refreshRate;        // <out>    Vertical Refresh Rate in Hz
  62.     VDSwitchInfoRec    switchInfo;            // <out>    DM2.0 uses this rather than displayMode/depthMode combo
  63. };
  64. typedef struct VideoRequestRec VideoRequestRec;
  65. typedef struct VideoRequestRec *VideoRequestRecPtr;
  66.  
  67. // Routine defines
  68. OSErr RVRequestVideoSetting(VideoRequestRecPtr requestRecPtr);
  69. OSErr RVGetCurrentVideoSetting(VideoRequestRecPtr requestRecPtr);
  70. OSErr RVSetVideoRequest (VideoRequestRecPtr requestRecPtr);
  71. OSErr RVConfirmVideoRequest (VideoRequestRecPtr requestRecPtr);
  72. OSErr RVSetVideoAsScreenPrefs (void);
  73.  
  74.